const path = require('path')
function resolve (dir) {
  return path.join(__dirname, dir)
}

module.exports = {
  parser: require('postcss-comment'),
  configureWebpack: {
    resolve: {
      alias: {
        // 设置@/的意义
        '@': resolve('src')
      }
    }
  },
  pluginOptions: {
    'style-resources-loader': {
      preProcessor: 'less'
    }
  }
  // require('postcss-import')({
  //   resolve (id, basedir, importOptions) {
  //     if (id.startsWith('~@/')) {
  //       return path.resolve(process.env.UNI_INPUT_DIR, id.substr(3))
  //     } else if (id.startsWith('@/')) {
  //       return path.resolve(process.env.UNI_INPUT_DIR, id.substr(2))
  //     } else if (id.startsWith('/') && !id.startsWith('//')) {
  //       return path.resolve(process.env.UNI_INPUT_DIR, id.substr(1))
  //     }
  //     return id
  //   }
  // }),
  // require('@dcloudio/vue-cli-plugin-uni/packages/postcss'),
}
